package com.meisupic.copyright.domain.po;

import static javax.persistence.EnumType.STRING;

import com.meisupic.copyright.common.PayWayEnum;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.DynamicUpdate;

/**
 * @Author lanjian
 * @Date 2018/3/18 下午3:55
 */
@Data
@Entity
@Table(name = "copyright_vip_order")
@DynamicUpdate
public class VipOrder {

  @Id
  @GeneratedValue
  private Long id;

  @Column(name = "order_no", length = 20, nullable = false)
  private String orderNo;

  @Column(name = "order_price", precision = 5, scale = 2, nullable = false)
  private BigDecimal orderPrice;

  @Column(name = "payWay", length = 20, columnDefinition = "enum('WEIXIN','ALIPAY')")
  @Enumerated(value = STRING)
  private PayWayEnum payWay;

  @Column(name = "payStatus", nullable = false, columnDefinition = "bit(1) default 0")
  private Boolean payStatus;

  @Column(name = "member_category_id",nullable = false)
  private Long memberCategoryId;

  @Column(name = "user_id", nullable = false, length = 20)
  private Long userId;

  @Column(name = "user_name", length = 50)
  private String userName;

  @Column(name = "invalid_time")
  private Date invalidTime;

  @Column(name = "order_time")
  @CreationTimestamp()
  private Date orderTime;

  @Column(name = "pay_time")
  private Date payTime;
}
